package com.shortUrl.starter;

import com.shortUrl.starter.verticle.DbVerticle;
import com.shortUrl.starter.verticle.HttpVerticle;
import com.shortUrl.starter.verticle.RedisVerticle;

import io.vertx.core.Launcher;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;

public class Runner extends Launcher {
    public static void main(String[] args) {
        VertxOptions vertxOptions = new VertxOptions()
                .setInternalBlockingPoolSize(2)
                .setWorkerPoolSize(2);
        Vertx vertx = Vertx.vertx(vertxOptions);
        vertx.deployVerticle(new HttpVerticle());
        vertx.deployVerticle(new RedisVerticle());
        vertx.deployVerticle(new DbVerticle());

        // Future<String> future =
        // Vertx.vertx().createDnsClient().lookup("www.baidu.com");
        // future.toCompletionStage().whenComplete((ip, err) -> {
        // if (err != null) {
        // System.err.println("Could not resolve vertx.io");
        // err.printStackTrace();
        // } else {
        // System.out.println("vertx.io => " + ip);
        // }
        // });
    }
}
